/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.apps.epocket.model;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "kod_negeri")
@NamedQueries({
    @NamedQuery(name = "KodNegeri.findAll", query = "SELECT k FROM KodNegeri k")})
public class KodNegeri implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "kod_negeri")
    private String kodNegeri;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "ketrgn_negeri")
    private String ketrgnNegeri;

    public KodNegeri() {
    }

    public KodNegeri(String kodNegeri) {
        this.kodNegeri = kodNegeri;
    }

    public KodNegeri(String kodNegeri, String ketrgnNegeri) {
        this.kodNegeri = kodNegeri;
        this.ketrgnNegeri = ketrgnNegeri;
    }

    public String getKodNegeri() {
        return kodNegeri;
    }

    public void setKodNegeri(String kodNegeri) {
        this.kodNegeri = kodNegeri;
    }

    public String getKetrgnNegeri() {
        return ketrgnNegeri;
    }

    public void setKetrgnNegeri(String ketrgnNegeri) {
        this.ketrgnNegeri = ketrgnNegeri;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (kodNegeri != null ? kodNegeri.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KodNegeri)) {
            return false;
        }
        KodNegeri other = (KodNegeri) object;
        if ((this.kodNegeri == null && other.kodNegeri != null) || (this.kodNegeri != null && !this.kodNegeri.equals(other.kodNegeri))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.apps.epocket.model.KodNegeri[ kodNegeri=" + kodNegeri + " ]";
    }
    
}
